<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="webctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>监测数据信息</title>
<link href="${webctx }/images/dcfs/baobiao.css" type="text/css" rel="stylesheet"/>

<script type="text/javascript" src="${webctx}/js/jquery-1.7.2.min.js"></script>
<style>
    body{font-family:宋体;font-size:11pt}
</style>
</head>
<body>
<form action="" method="post" id="form1">
<div style="overflow:auto; position:relative; height:100%;">
	<div id="table" align="center">
		<table align="center" border="1" cellspacing="0" cellpadding="0" width="80%">
		<tr>
		<td align="center" valign="middle" class="title"><label id="jzmc"></label>监测数据信息</td>
		</tr>
		</table>
		<div id="tscljcsj" align="center"></div>
		<div id="tsclsj" align="center"></div>
	  
	</div>
	<div id="div1" align="center">
	<input type="button" name="Word" value="导出表格" onClick="loadWord()" id="sub"/>
	<input type="button" name="button" id="button" value="打印" onClick="unloadWord();javascript:print();" />
	<input  type="button" onclick="ret()" value="返回" /></input>
	<input type="hidden" id="tableInfo" name="tableInfo" value=""/>
	</div>

</div>   
</form>
<script type="text/javascript">
   
    function unloadWord(){
		document.getElementById("form1").removeChild(document.getElementById("div1"));
	}
	
	
	
	//获取url的参数
	var url = location.search;
	var theRequest = new Object(); 
    if (url.indexOf("?") != -1) { 
       var str = url.substr(1); 
       strs = str.split("&"); 
       var jzsbbh=strs[0].split("=")[1];
       var tsbh=strs[1].split("=")[1];
      // alert(tsbh);
    }
	
	var jzsb_result='';
    var param2={'dcfsJzSbJbxx.jzsbbh':jzsbbh};
	$.ajax({
		async:false,
		type:"POST",
		url:"${webctx}/tsjzsb_getDcfsJzSbJbxxList_ggts.action",
		data:param2,
		timeout:2000,
		success:function(object,bool,response){
			jzsb_result=eval(response.responseText);
			
			$("#jzmc").html(jzsb_result[0].jzsbmc);
		},
		failure:function(response){
			alert("加载失败");
		}
	});
    
	function loadWord(){
       //document.getElementById("tableInfo").value=document.getElementById("table").innerHTML;
      // alert($("#jzmc").val());
      	//document.getElementById("form1").action="${webctx }/exp_ExportToWord.action?sbmc="+jzsb_result[0].jzsbmc;
      	//document.getElementById("form1").submit();
		location.href = "${webctx }/exp_ExportToWordNewData.action?jzsbbh="+jzsbbh+"&tsbh="+tsbh+"&sbmc="+jzsb_result[0].jzsbmc;
    }
    
    var param1={'dcfsHjjcdJbxx.jzsbbh':jzsbbh};
	$.ajax({
		url:"${webctx}/jcjgN_getJcsj.action",
		method:"POST",
		data:param1,
		params:{},
		success:function(object,bool,response){
			result1=eval(response.responseText);
			//alert(result1.length);
			var htmlStr='<table align="center"  border="1" cellpadding="0" cellspacing="0" class="" width="80%">';
			htmlStr+=' <tr><td height="36" colspan="7" align="center" class="list_1">监测数据</td></tr>';
			htmlStr+='<tr><td height="36" width="10%" align="center" class="list_2">编号</td><td width="20%" align="center" class="list_2">测点名称</td><td width="10%" align="center" class="list_2">相对基站方位</td><td width="20%" align="center" class="list_2">测试距天线水平距离（m）</td><td width="20%" align="center" class="list_2">测试距天线垂直距离（m）</td><td width="10%" align="center" class="list_2">电场强度E</td><td width="10%" align="center" class="list_2">功率密度</td></tr>';
			for(var i=0;i<result1.length;i++){
				htmlStr+='<tr>';
				htmlStr+='<td height="36" width="10%" align="center" class="list_3">'+(result1[i].jcdbm==""?"-":result1[i].jcdbm)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result1[i].jcdmc==""?"-":result1[i].jcdmc)+'</td>';
				htmlStr+='<td width="10%" align="center" class="list_3">'+(result1[i].jcdxdfw==""?"-":result1[i].jcdxdfw)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result1[i].jcdxdjlsp==""?"-":result1[i].jcdxdjlsp)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result1[i].jcdxdjlcz==""?"-":result1[i].jcdxdjlcz)+'</td>';
				htmlStr+='<td width="10%" align="center" class="list_3">'+(result1[i].jcddcqd==""?"-":result1[i].jcddcqd)+'</td>';
				htmlStr+='<td width="10%" align="center" class="list_3">'+(result1[i].jcdglmd==""?"-":result1[i].jcdglmd)+'</td>';
				htmlStr+='</tr>';
			}
			htmlStr+='</table>';
			//alert(htmlStr);
			$("#tscljcsj").html(htmlStr);
					
		},
		failure:function(response){
			Ext.Msg.alert("提示","加载失败");
		}
	});
    
    
    var param={'dcfsTsclTsjcsjJbxx.tsbh':tsbh};
	$.ajax({
		url:"${webctx}/jcjgN_getTsclJbxx.action",
		method:"POST",
		data:param,
		params:{},
		success:function(object,bool,response){
			result=eval(response.responseText);
			//alert(result.length);
			var htmlStr='<table align="center"  border="1" cellpadding="0" cellspacing="0" class="" width="80%">';
			htmlStr+=' <tr><td height="36" colspan="6" align="center" class="list_1">推算数据</td></tr>';
			htmlStr+='<tr><td height="36" width="10%" align="center" class="list_2">投诉编号</td><td width="10%" align="center" class="list_2">名称</td><td width="10%" align="center" class="list_2">相对方位</td><td width="20%" align="center" class="list_2">水平距离（m）</td><td width="20%" align="center" class="list_2">垂直距离（m）</td><td width="20%" align="center" class="list_2">功率密度</td></tr>';
			for(var i=0;i<result.length;i++){
				htmlStr+='<tr>';
				htmlStr+='<td height="36" width="10%" align="center" class="list_3">'+(result[i].jcdbm==""?"-":result[i].jcdbm)+'</td>';
				htmlStr+='<td width="10%" align="center" class="list_3">'+(result[i].jcdmc==""?"-":result[i].jcdmc)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result[i].jcdxdfw==""?"-":result[i].jcdxdfw)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result[i].jcdxdjlsp==""?"-":result[i].jcdxdjlsp)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result[i].jcdxdjlcz==""?"-":result[i].jcdxdjlcz)+'</td>';
				htmlStr+='<td width="20%" align="center" class="list_3">'+(result[i].apdvalue==""?"-":result[i].apdvalue)+'</td>';
				htmlStr+='</tr>';
				
			}
			htmlStr+='</table>';
			$("#tsclsj").html(htmlStr);
					
		},
		failure:function(response){
			Ext.Msg.alert("提示","操作出现了异常！");
		}
	});
	function ret(){
		//alert("ss");
		window.location.href="${webctx }/dcfs_ggts/dcfs_ggts_cl_jbxx.jsp?id="+tsbh+"&sb="+jzsbbh;
	}
</script>
</body>
 
</html>
